<?
//status: regmail:0 ; off: 1; onchat:2; oncpanel: 3 ; lock:4


$password= isset($_POST['password']) ? $_POST['password'] : "";
$fullname= isset($_POST['fullname']) ? $_POST['fullname'] : "";
$email= isset($_POST['email']) ? $_POST['email'] : "";
$Welcome= isset($_POST['Welcome']) ? $_POST['Welcome'] : "";
$Website= isset($_POST['Website']) ? $_POST['Website'] : "";

// up banner image:	 
$folderBanner=_DIRBANNER; 
$ImgBanner =	isset($_POST['ImgBanner']) ? $_POST['ImgBanner'] : '';
$ImgFileBanner=isset($_FILES["ImgFileBanner"]) ? $_FILES["ImgFileBanner"] : '';	  
if($namefile=upImage($ImgFileBanner,$folderBanner))
{
  $ImgBanner=$namefile;
}	

if(!empty($email))
{
	$updatepass="";
	if(!empty($password))
	{
		$password=md5($password);
		$updatepass=",cPassword='".$password."'";		
	}
	$sql_update="update ".$GLOBALS['first_table']."tbluser set 
				cFullName	= '$fullname',
				cBanner		= '$ImgBanner',
				cWebsite	= '$Website',
				cEmail		= '$email',
				cWelcome    = '$Welcome'
				".$updatepass." where iUserId='$userid'";
	$rs=$dbsql->query($sql_update);
	if($rs)
	{
		$alert="Update Success!";
	}
}

$rs=$dbsql->query("select * from ".$GLOBALS['first_table']."tbluser where iUserId='$userid'");
$user=$dbsql->fetch_array($rs);
?>